package com.study.studyroom.entity.exception;

import com.study.studyroom.entity.bo.RequestResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(GlobalException.class)
    public RequestResult<?> handlerGlobalException(GlobalException globalException){
        return RequestResult.fail(globalException.getRequestResultEnum());
    }

}
